package com.jozen.modelbase.netwoek.util;

import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;

/**
 * 闪烁动画
 */
public class FlashUtil {
    private Animation animation;

    public FlashUtil(){
        animation = new AlphaAnimation(0.1f,1.0f);
        animation.setRepeatMode(Animation.RESTART);//动画结束后，从头开始
        animation.setRepeatCount(Animation.INFINITE);//重复多次
        animation.setFillAfter(true);
        animation.setDuration(500);
        animation.setStartOffset(500);//动画执行的延迟时间
        animation.start();
    }

    public void showText(View view){
        view.setAnimation(animation);
    }

}
